import { PermissionModel } from '@2/typings/model/permission.model';
import { ApiUser } from '@2/app/core/api/api.user';
import { defHttp } from '@/utils/http/axios';
import { Enums } from '@2/app/core/api/enums';
import { injectable } from 'inversify';
import { AppUser } from '@2/typings/model/app.user';
/**
 * @program: microservice-central-portal
 * @description: 获取授权接口定义实现
 * @author: baiHoo.chen
 * @create: 2024-04-07
 **/
@injectable()
export class ApiUserImpl implements ApiUser {
  getUserMenus(id: number): Promise<PermissionModel[]> {
    return defHttp.get<PermissionModel[]>({ url: Enums.MENUS_BY_ID + '/' + id });
  }
  getByUsername(username: string): Promise<AppUser> {
    return defHttp.get<AppUser>({ url: Enums.USER_BY_USERNAME + '/' + username });
  }
}
